<?php

global $_GPC, $_W;
$GLOBALS['frames'] = $this->getMainMenu();

/*if($_GPC['keywords']){
  $rst=pdo_get('zhjr_system',array('uniacid'=>$_W['uniacid']));
  $appkey=$rst['gp_appkey'];
  $url = "http://web.juhe.cn:8080/finance/stock/hs";
$params = array(
      "gid" => $_GPC['keywords'],//股票编号，上海股市以sh开头，深圳股市以sz开头如：sh601009
      "key" => $appkey,//APP Key
);
$paramstring = http_build_query($params);
$content = $this->juhecurl($url,$paramstring);
$result = json_decode($content,true);
if($result){
    if($result['error_code']=='0'){
        //print_r($result['result']);die;
    }else{
        echo $result['error_code'].":".$result['reason'];
    }
}else{
    echo "请求失败";
}
}*/
if(checksubmit('submit')){//添加推荐股
$data['gp_name']=$_GPC['gp_name'];
 $data['gid']=$_GPC['gid'];
  $data['sort']=$_GPC['sort'];
 $data['time']=time();
 $data['uniacid']=$_W['uniacid'];
 $rst=pdo_insert('zhjr_recommend',$data);
 if($rst){
     message('添加成功！', $this->createWebUrl('recommend'), 'recommend');
 }else{
  message('添加失败！','','error');
 
}
}

include $this->template('web/addrecommend');